<?php
include 'config.php';
include 'functions.php';
$userid = $_SESSION['userid'];
$lexcreated = $_SESSION['lexcreated']; 
$lexid = getLexid($lexcreated);
$_SESSION['lexid'] = $lexid;
?>
<!doctype HTML>
<title>Index</title>
<html>
	<head>
		<!-- <link href="css/dropzone.css" type="text/css" rel="stylesheet" /> -->
				<script src="js/dropzone.js"></script>
			</head>
	<script>
		Dropzone.options.artefact = {
			autoProcessQueue : false, // stop processing until submit button pressed
			clickable : '#dropArea',
			previewsContainer : '#dropArea',
			parallelUploads : 10,
			accept : function(file, done) {
				done();
			},
			error : function(file, msg) {
				alert(msg);
			},
			init : function() {
				var myDropzone = this;
				this.element.querySelector("button").addEventListener("click", function(e) {
					//e.preventDefault();
					e.stopPropagation();
					if (myDropzone.getQueuedFiles().length > 0) {
						myDropzone.processQueue();
						
					} else {
						myDropzone.uploadFiles([]);//send empty
					}
									});
			}
		
		};
	
		</script>
	

	<body>

		<div class="overlayResult"></div>
			<div class="modalForm">
			<p class="modalTitle">New Lex - 2/2</p>
			<div id = "formContainer" class="scrollable">
			<h2 class="formTitle"><?php echo $_SESSION['lextitle'];?></h2>
			<form action="parse_newlex2.php" class="dropzone stdformbg" id="artefact" method="post">
					<h4>Artefacts</h4>
					<p class="artefactLabel">Drag files here or click to upload</p>
					<div id="dropArea">
					
				</div>
				<div class="dz-default dz-message"></div>
				<div class="dropzonePreview"></div>
				
					<div id="tags">
						<h4>My Tags</h4>
						<label for="tb_tag">Tags</label>
						<input type="text" id="tb_tag" name="tb_tag" />
					</div>
					<div class="offSwitch">
								<p class="manualLabel">Allow Comments</p>
								<input type="checkbox" name="cb_allowcomment" id="cb_allowcomment" value="1" />
							<label for="cb_allowcomment"></label>
						
						</div>
					<hr class="hrLight">
					<div class="offSwitch">
							<p class="manualLabel">My eyes only</p>
							
							<input type="checkbox" name="cb_allowprivate" id="cb_allowprivate" value="1" class="offSwitch" />
							<label for="cb_allowprivate"></label>
							
						</div>
						<input type="hidden" name="tb_lexTitle" value="<?php echo $_SESSION['lextitle']; ?>"/>
						<input type="hidden" name="tb_lexid" value="<?php echo $_SESSION['lexid']; ?>"/>
				
		<button type="submit" id="" name="" class="right btn">Submit</button>
			</form>
			
	</div>
		</div>

</body>
</html>
